<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
  <title>Test Case for console object</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>

<h1>Console object API: time, timeEnd</h1>

<p>This test-case is intended for <b>console.time</b> and <b>console.timeEnd</b> method.
<br/>
<i>Jan Odvarko, odvarko@gmail.com</i>
</p>

<ol>
<li>Open Firebug and enable the Console panel.</li>
<li>Click on the <code style="color:green">Execute Test</code> button below.</li>
<li>The console panels should display elapsed time around 1000ms</li>
</ol>

<button id="testButton" onclick="onExecuteTest()">Execute Test</button>
<br/><br/>

<script type="text/javascript">
function onExecuteTest()
{
    console.time("a");
    var n = now();
    while (now() < + n+1000) {
        var a = 10;
    }
    console.timeEnd("a");
}

function now()
{
    return (new Date()).getTime();
}
</script>

</body>
</html>
